import { RequestHandler } from 'express'
import { failure, success } from '@/utils/response'
import attrvalueService from '@/services/attrvalueService'

const addValue: RequestHandler = async function (req, res) {
  try {
    const data = await attrvalueService.addValue(req.body.value)
    success(res, '添加属性值成功。', data, 201)
  } catch (error) {
    failure(res, error as Error, '添加属性值失败：')
  }
}

export default {
  addValue,
}
